import { View } from "../../../mvc/core/View";
import { Cache } from "../../cache/Cache";
import { Global } from "../../../../com/gengine/global/Global";
import { Language } from "../../../../extend/language/Language";
import { HTMLUtil } from "../../../../com/gengine/utils/HTMLUtil";
import { GlobalStyle } from "../../../common/global/GlobalStyle";
import { FlowerBg } from "../common/FlowerBg";
import { ObjCreate } from "../common/ObjCreate";
import { ImagesConst } from "../../resource/ImagesConst";
import { LongProgressBar } from "../player/LongProgressBar";
import { GTextFormat } from "../../../common/GTextFormat";
import { FontUtil } from "../../../common/font/FontUtil";
import { FightSpiritAttView } from "./FightSpiritAttView";
import { ResFileConst } from "../../resource/ResFileConst";
import { GlobalClass } from "../../../../com/mui/core/GlobalClass";
import { ItemConfig } from "../../resource/ItemConfig";
import { ECategory } from "../../../../Message/Public/ECategory";
import { EProp } from "../../../../Message/Public/EProp";
import { ItemData } from "../../resource/info/ItemData";
import { BaseItem } from "../common/BaseItem";
import { FilterConst } from "../../../component/gconst/FilterConst";
import { LoaderHelp } from "../../../common/display/LoaderHelp";
import { Alert } from "../../../../com/mui/controls/Alert";
import { MsgManager } from "../../manager/MsgManager";
import { Dispatcher } from "../../../mvc/core/Dispatcher";
import { DataEvent } from "../../events/DataEvent";
import { EventName } from "../../mvc/EventName";
import { GameConst } from "../../../component/gconst/GameConst";
import { FightSpiritConfig } from "../../resource/FightSpiritConfig";
import { TFightSpirit } from "../../../../Message/Db/Tables/TFightSpirit";
import { PublicMessageConfig } from "../../resource/PublicMessageConfig";
import { ParamsConst } from "../../../common/global/ParamsConst";
import { PulseSharedObject } from "../player/PulseSharedObject";
import { EVIPType } from "../../../../Message/Public/EVIPType";
import { VIPConfig } from "../../resource/VIPConfig";
import { VIPInfo } from "../../resource/info/VIPInfo";
import { AttriAddEffect } from "../effect/AttriAddEffect";
import { TweenLite } from "../../../../com/greensock/TweenLite";
import { SWFPlayer } from "../../scene/modle/SWFPlayer";
import { ModelType } from "../../scene/modle/data/ModelType";
import { GLoadedButton } from "../../../../com/mui/controls/GLoadedButton";
import { GTextFiled } from "../../../../com/mui/controls/GTextFiled";
import { GButton } from "../../../../com/mui/controls/GButton";
import { GLabel } from "../../../../com/mui/controls/GLabel";
import { _propArr } from "../../../../this/_propArr";
type int = number;
//class FightSpiritRisePanel
    
    export  class FightSpiritRisePanel extends View
    {
        constructor()
        {
            super();
            this._propArr = [];
            this.initView();
            return;
        }

        public timeChange(arg1: Boolean): void
        {
            if (arg1) 
            {
                this._todayNum = this.getRealCount(Cache.instance.vip.vipInfo.VIPType.value()) - Cache.instance.role.fightSpiritTime;
            }
            else 
            {
                this._todayNum = this.getRealCount(Cache.instance.role.entityInfo.VIP) - Cache.instance.role.fightSpiritTime;
            }
            if (!Global.isDebugModle) 
            {
                if (this._todayNum < 0) 
                {
                    this._todayNum = 0;
                }
            }
            if (Global.isDebugModle) 
            {
                this._todayCountTx.htmlText = Language.getStringByParam(71107, this._todayNum);
                this._riseComBtn.enabled = true;
                this._riseBestBtn.enabled = true;
            }
            else if (this._todayNum > 0) 
            {
                this._todayCountTx.htmlText = Language.getStringByParam(71107, this._todayNum);
                this._riseComBtn.enabled = true;
                this._riseBestBtn.enabled = true;
            }
            else 
            {
                this._todayCountTx.htmlText = Language.getStringByParam(71108, this._todayNum);
                this._riseComBtn.enabled = false;
                this._riseBestBtn.enabled = false;
            }
            return;
        }

        public updateResetTime(): void
        {
            this._againBtn.toolTipData = Language.getStringByParam(27701, Cache.instance.role.fightSpiritExtraDays);
            this._setLink.htmlText = HTMLUtil.addColor(Language.getStringByParam(27705, Cache.instance.role.fightSpiritExtraDays), GlobalStyle.color2);
            this._setLink.toolTipData = Language.getStringByParam(27701, Cache.instance.role.fightSpiritExtraDays);
            return;
        }

        /* internal  */initView(): void
        {
            var loc1=new FlowerBg(432, 432);
            addChild(loc1);
            this._stCurBm = ObjCreate.createBitmap("", 50, 15, this);
            this._stArrowBm = ObjCreate.createBitmap("", 183, 7, this);
            this._stNextBm = ObjCreate.createBitmap("", 260, 15, this);
            ObjCreate.createBg(6, 218, 418, 210, this);
            ObjCreate.createBg(0, 221, 139, 22, this, ImagesConst.TileBg);
            this._stCurExpBm = ObjCreate.createBitmap("", 11, 225, this);
            this._prograssBar = new LongProgressBar();
            this._prograssBar.x = 64;
            this._prograssBar.y = 256;
            this._prograssBar.progressBarClass = ImagesConst.EnergyBar;
            this._prograssBar.setBgSize(298, 16);
            this._prograssBar.setValue(0, 100);
            this.addChild(this._prograssBar);
            this._barCurLevelTx = ObjCreate.createTextField("", 10, 256, 52, 20, this, new GTextFormat(FontUtil.EmbedNumberName, 18, 6350622));
            this._barCurLevelTx.embedFonts = true;
            this._barNextLevelTx = ObjCreate.createTextField("", 364, 256, 52, 20, this, new GTextFormat(FontUtil.EmbedNumberName, 18, 6350622));
            this._barNextLevelTx.embedFonts = true;
            this._barCurLevelTx.autoSize = flash.text.TextFormatAlign.CENTER;
            this._barNextLevelTx.autoSize = flash.text.TextFormatAlign.CENTER;
            ObjCreate.createBg(6, 50, 207, 164, this);
            ObjCreate.createBg(217, 50, 207, 164, this);
            this._curAddSp = new FightSpiritAttView();
            this._curAddSp.x = 5;
            this._curAddSp.y = 62;
            addChild(this._curAddSp);
            this._newAddSp = new FightSpiritAttView();
            this._newAddSp.x = 221;
            this._newAddSp.y = 62;
            addChild(this._newAddSp);
            this._todayCountTx = ObjCreate.createTextField("", 75, 280, 158, 20, this, GlobalStyle.textFormat2);
            this._riseComBtn = ObjCreate.createGButton(Language.getString(71124), 80, 390, 62, 26, this, "ButtonRedMini");
            this._riseComBtn.addEventListener(flash.events.MouseEvent.CLICK, this.goRise);
            this._riseBestBtn = ObjCreate.createGButton(Language.getString(71125), 292, 390, 62, 26, this, "ButtonRedMini");
            this._riseBestBtn.addEventListener(flash.events.MouseEvent.CLICK, this.goRise);
            this._vipAddTx = ObjCreate.createTextField("", 225, 280, 85, 20, this, GlobalStyle.textFormat5);
            this._vipAddTx.autoSize = flash.text.TextFormatAlign.CENTER;
            this._againBtn = ObjCreate.createGLoadedButton(ResFileConst.PackAdd, 316, 279, 23, 23, this);
            this._againBtn.addEventListener(flash.events.MouseEvent.CLICK, this.onAaginBtnClick);
            this._againBtn.toolTipData = Language.getStringByParam(27701, Cache.instance.role.fightSpiritExtraDays);
            this._setLink = ObjCreate.createGTextField("", 341, 281, 100, 20, this);
            this._setLink.autoSize = flash.text.TextFieldAutoSize.LEFT;
            this._setLink.htmlText = HTMLUtil.addColor(Language.getStringByParam(27705, Cache.instance.role.fightSpiritExtraDays), GlobalStyle.color2);
            this._setLink.addEventListener(flash.events.TextEvent.LINK, this.onSetLinkClick);
            this._setLink.toolTipData = Language.getStringByParam(27701, Cache.instance.role.fightSpiritExtraDays);
            this._helpTx = ObjCreate.createGTextField("", 295, 225, 66, 20, this, GlobalStyle.textFormat5);
            this._helpTx.htmlText = Language.getString(71127);
            ObjCreate.createBg(49, 317, 50, 22, this, ImagesConst.PopUpMenuOverSkin);
            ObjCreate.createBg(258, 317, 50, 20, this, ImagesConst.PopUpMenuOverSkin);
            this._expRiseTx = ObjCreate.createTextField("", 28, 318, 120, 20, this);
            this._expRiseTx.htmlText = Language.getString(71132);
            this._expHightRiseTx = ObjCreate.createTextField("", 240, 318, 120, 20, this);
            this._expHightRiseTx.htmlText = Language.getString(71133);
            this._mRiseTx = ObjCreate.createTextField("", 28, 340, 120, 20, this);
            this._mRiseTx.htmlText = Language.getString(71112);
            this._mHightRiseTx = ObjCreate.createTextField("", 240, 340, 120, 20, this);
            this._mHightRiseTx.htmlText = Language.getString(71126);
            this._itemBg = GlobalClass.getBitmap(ImagesConst.PackItemBg);
            this._itemBg.x = 150;
            this._itemBg.y = 332;
            this.addChild(this._itemBg);
            this._itemBgII = GlobalClass.getBitmap(ImagesConst.PackItemBg);
            this._itemBgII.x = 362;
            this._itemBgII.y = 332;
            this.addChild(this._itemBgII);
            var loc2=ItemConfig.instance.getItemByTypeAndLevel(ECategory._ECategoryProp, EProp._EPropAncientLeftSpirit);
            var loc3=loc2.item.code;
            this._idata = new ItemData(loc3);
            this._baseItem = new BaseItem();
            this._baseItem.setSize(32, 32);
            this._baseItem.x = this._itemBg.x + 3;
            this._baseItem.y = this._itemBg.y + 3;
            this._baseItem.itemData = this._idata;
            this.addChild(this._baseItem);
            this._baseItemII = new BaseItem();
            this._baseItemII.setSize(32, 32);
            this._baseItemII.x = this._itemBgII.x + 3;
            this._baseItemII.y = this._itemBgII.y + 3;
            this._baseItemII.itemData = this._idata;
            this.addChild(this._baseItemII);
            this._hintLabel = ObjCreate.createLabel("", 90, 225, 260, 100, flash.text.TextFormatAlign.CENTER, this);
            this._hintLabel.mouseEnabled = false;
            this._hintLabel.mouseChildren = false;
            this._hintLabel.visible = false;
            this._hintLabel.textField.filters = [FilterConst.taskShowTargetFilter];
            this._stComBm = ObjCreate.createBitmap("", 76, 303, this);
            this._stBestBm = ObjCreate.createBitmap("", 275, 303, this);
            ObjCreate.createBg(67, 364, 51, 22, this, ImagesConst.DisabledBg);
            var loc4=ObjCreate.createTextField(Language.getString(70023), 28, 366, 34, 20, this, GlobalStyle.textFormat2);
            ObjCreate.createBitmap(ImagesConst.Tongqian_small, 120, 366, this);
            this._txRiseCost = ObjCreate.createTextField("", 77, 366, 54, 20, this, GlobalStyle.textFormat2);
            ObjCreate.createBg(279, 364, 51, 22, this, ImagesConst.DisabledBg);
            var loc5=ObjCreate.createTextField(Language.getString(70023), 240, 366, 34, 20, this, GlobalStyle.textFormat2);
            ObjCreate.createBitmap(ImagesConst.Tongqian_small, 332, 366, this);
            this._txHightRiseCost = ObjCreate.createTextField("", 289, 366, 54, 20, this, GlobalStyle.textFormat2);
            ObjCreate.createBg(215, 305, 150, 3, this, ImagesConst.Line).rotation = 90;
            LoaderHelp.addResCallBack(ResFileConst.FightSpirit, this.onLoadBmResource);
            return;
        }

        /* internal  */onLoadBmResource(): void
        {
            this._stCurBm.bitmapData = GlobalClass.getBitmapData(ImagesConst.FightSpirit_curSpirit);
            this._stArrowBm.bitmapData = GlobalClass.getBitmapData(ImagesConst.FightSpirit_arrow);
            this._stNextBm.bitmapData = GlobalClass.getBitmapData(ImagesConst.FightSpirit_nextSpirit);
            this._stCurExpBm.bitmapData = GlobalClass.getBitmapData(ImagesConst.FightSpirit_expDect);
            this._stComBm.bitmapData = GlobalClass.getBitmapData(ImagesConst.FightSpiritCommonRise);
            return;
        }

        /* internal  */onSetLinkClick(arg1): void
        {
            this.onAaginBtnClick(null);
            return;
        }

        protected onAaginBtnClick(arg1: Object /* flash.events.MouseEvent */=null): void
        {
            if (Cache.instance.role.fightSpiritExtraDays != 0) 
            {
                Alert.show(Language.getStringByParam(27703, Cache.instance.role.fightSpiritExtraDays), null, Alert.OK | Alert.CANCEL, null, this.onBtnClickHandlerI);
            }
            else 
            {
                MsgManager.showRollTipsMsg(Language.getString(27702));
            }
            return;
        }

        /* internal  */onBtnClickHandlerI(arg1: int): void
        {
            if (arg1 == Alert.OK) 
            {
                Alert.resetToDefault();
                Dispatcher.dispatchEvent(new DataEvent(EventName.FightSpiritGoUpdateTimes));
            }
            return;
        }

        /* internal  */updateBar(): void
        {
            if (Cache.instance.role.fightSpiritLevel != GameConst.MaxFightSpiritLevel) 
            {
                this._prograssBar.setValue(Cache.instance.role.fightSpiritExp, this.needExp(Cache.instance.role.fightSpiritLevel));
            }
            else 
            {
                this._prograssBar.setValue(0, 0);
            }
            this._barCurLevelTx.text = "Lv." + Cache.instance.role.fightSpiritLevel;
            if (Cache.instance.role.fightSpiritLevel + 1 > GameConst.MaxFightSpiritLevel) 
            {
                this._barNextLevelTx.visible = false;
                return;
            }
            this._barNextLevelTx.visible = true;
            this._barNextLevelTx.text = "Lv." + (Cache.instance.role.fightSpiritLevel + 1);
            return;
        }

        /* internal  */needExp(arg1: int): int
        {
            return (FightSpiritConfig.instance.getFightSpiritInfo(arg1) as TFightSpirit).needExp;
        }

        public updateInfo(arg1: Array<any>): void
        {
            this.updateLeftInfo(arg1, Cache.instance.role.fightSpiritLevel, Cache.instance.role.fightSpiritBreakLv);
            this.updateRightInfo(arg1, Cache.instance.role.fightSpiritLevel + 1, Cache.instance.role.fightSpiritBreakLv);
            this.updateBar();
            this.updateAllCost(Cache.instance.role.fightSpiritLevel);
            return;
        }

        /* internal  */updateAllCost(arg1: int): void
        {
            this._tFightSpirit = FightSpiritConfig.instance.getFightSpiritInfo(arg1);
            if (this._tFightSpirit) 
            {
                this._expRiseTx.htmlText = Language.getStringByParam(71136, this._tFightSpirit.generalExp);
                this._expHightRiseTx.htmlText = Language.getStringByParam(71137, this._tFightSpirit.highExp);
                this._mRiseTx.htmlText = Language.getStringByParam(71138, this._tFightSpirit.generalGhost);
                this._mHightRiseTx.htmlText = Language.getStringByParam(71138, this._tFightSpirit.highGhost);
                this._txRiseCost.text = this._tFightSpirit.generalMoney.toString();
                this._txHightRiseCost.text = this._tFightSpirit.highMoney.toString();
                this._riseComBtn.toolTipData = Language.getStringByParam(71139, this._tFightSpirit.generalGhost, this._tFightSpirit.generalExp);
                this._riseBestBtn.toolTipData = Language.getStringByParam(71140, this._tFightSpirit.highGhost, this._tFightSpirit.highExp);
                if (arg1 < 150) 
                {
                    this._helpTx.toolTipData = "<textFormat leading=\'4\'>" + PublicMessageConfig.instance.getFightSpiritTextByName("FightSpirit") + "</textFormat>";
                }
                else 
                {
                    this._helpTx.toolTipData = "<textFormat leading=\'4\'>" + Language.getString(71141) + "</textFormat>";
                }
            }
            return;
        }

        /* internal  */updateLeftInfo(arg1: Array<any>, arg2: int, arg3: int): void
        {
            this._curAddSp.processData(arg1, arg2, arg3);
            return;
        }

        /* internal  */updateRightInfo(arg1: Array<any>, arg2: int, arg3: int): void
        {
            if (arg2 > GameConst.MaxFightSpiritLevel) 
            {
                this._newAddSp.visible = false;
                return;
            }
            this._newAddSp.visible = true;
            this._newAddSp.processData(arg1, arg2, arg3);
            return;
        }

        protected goRise(arg1: Object /* flash.events.MouseEvent */): void
        {
            var event: Object /* flash.events.MouseEvent */;
            var checkFlag: Boolean;
            var onClose: Function;

            var loc1;
            checkFlag = false;
            event = arg1;
            if (ParamsConst.Version == "1.0.9.2" && Cache.instance.role.fightSpiritLevel >= 130) 
            {
                MsgManager.showRollTipsMsg(Language.getString(79001));
                return;
            }
            this.dispatchEvent(new DataEvent("FightSpiritGuideArrow", null, false, true, true));
            var loc2=event.target;
            switch (loc2) 
            {
                case this._riseComBtn:
                {
                    if (Global.isDebugModle) 
                    {
                        this.checkPropInPack();
                        if (this._hasAmount >= this._tFightSpirit.generalGhost) 
                        {
                            if (Cache.instance.login.loginGame.money.coin + Cache.instance.login.loginGame.money.coinBind >= this._tFightSpirit.generalMoney) 
                            {
                                Dispatcher.dispatchEvent(new DataEvent(EventName.FightSpiritGoUpGrade, {"propArr": _propArr, "type": 1}));
                            }
                            else 
                            {
                                MsgManager.showRollTipsMsg(Language.getString(20038));
                                Dispatcher.dispatchEvent(new DataEvent(EventName.ShopMallAutoBuyCoin, this._tFightSpirit.generalMoney));
                            }
                        }
                        else 
                        {
                            MsgManager.showRollTipsMsg(Language.getString(71109));
                        }
                        return;
                    }
                    if (this._todayNum > 0) 
                    {
                        this.checkPropInPack();
                        if (this._hasAmount >= this._tFightSpirit.generalGhost) 
                        {
                            if (Cache.instance.login.loginGame.money.coin + Cache.instance.login.loginGame.money.coinBind >= this._tFightSpirit.generalMoney) 
                            {
                                Dispatcher.dispatchEvent(new DataEvent(EventName.FightSpiritGoUpGrade, {"propArr": _propArr, "type": 1}));
                            }
                            else 
                            {
                                MsgManager.showRollTipsMsg(Language.getString(20038));
                                Dispatcher.dispatchEvent(new DataEvent(EventName.ShopMallAutoBuyCoin, this._tFightSpirit.generalMoney));
                            }
                        }
                        else 
                        {
                            MsgManager.showRollTipsMsg(Language.getString(71109));
                        }
                    }
                    else 
                    {
                        MsgManager.showRollTipsMsg(Language.getString(71110));
                    }
                    break;
                }
                case this._riseBestBtn:
                {
                    if (Cache.instance.role.fightSpiritLevel < 150) 
                    {
                        onClose = (arg1: int): void
                        {
                            if (arg1 == Alert.OK) 
                            {
                                PulseSharedObject.saveValue("FightSpiritBestRiseTips", true);
                                goBestRise();
                            }
                            return;
                        }
                        checkFlag = PulseSharedObject.getValue("FightSpiritBestRiseTips");
                        if (checkFlag) 
                        {
                            this.goBestRise();
                        }
                        else 
                        {
                            Alert.show(Language.getString(71129), null, Alert.OK | Alert.CANCEL, null, onClose);
                        }
                    }
                    else 
                    {
                        this.goBestRise();
                    }
                }
                default:
                {
                    break;
                }
            }
            return;
        }

        /* internal  */goBestRise(): void
        {
            if (Global.isDebugModle) 
            {
                this.checkPropInPack();
                if (this._hasAmount >= this._tFightSpirit.highGhost) 
                {
                    if (Cache.instance.login.loginGame.money.coin + Cache.instance.login.loginGame.money.coinBind >= this._tFightSpirit.highMoney) 
                    {
                        Dispatcher.dispatchEvent(new DataEvent(EventName.FightSpiritGoUpGrade, {"propArr": _propArr, "type": 2}));
                    }
                    else 
                    {
                        MsgManager.showRollTipsMsg(Language.getString(20038));
                        Dispatcher.dispatchEvent(new DataEvent(EventName.ShopMallAutoBuyCoin, this._tFightSpirit.highMoney));
                    }
                }
                else 
                {
                    MsgManager.showRollTipsMsg(Language.getString(71109));
                }
                return;
            }
            if (this._todayNum > 0) 
            {
                this.checkPropInPack();
                if (this._hasAmount >= this._tFightSpirit.highGhost) 
                {
                    if (Cache.instance.login.loginGame.money.coin + Cache.instance.login.loginGame.money.coinBind >= this._tFightSpirit.highMoney) 
                    {
                        Dispatcher.dispatchEvent(new DataEvent(EventName.FightSpiritGoUpGrade, {"propArr": _propArr, "type": 2}));
                    }
                    else 
                    {
                        MsgManager.showRollTipsMsg(Language.getString(20038));
                        Dispatcher.dispatchEvent(new DataEvent(EventName.ShopMallAutoBuyCoin, this._tFightSpirit.highMoney));
                    }
                }
                else 
                {
                    MsgManager.showRollTipsMsg(Language.getString(71109));
                }
            }
            else 
            {
                MsgManager.showRollTipsMsg(Language.getString(71110));
            }
            return;
        }

        public checkPropInPack(): void
        {
            var loc1=0;
            this._propArr = [];
            this._hasAmount = 0;
            this._propNum = Cache.instance.pack.backPackCache.getPropByType(EProp._EPropAncientLeftSpirit).length;
            if (this._propNum > 0) 
            {
                this._baseItem.filters = [];
                this._baseItemII.filters = [];
                this._propArr = Cache.instance.pack.backPackCache.getPropByType(EProp._EPropAncientLeftSpirit);
                loc1 = 0;
                while (loc1 < this._propNum) 
                {
                    this._hasAmount = this._hasAmount + (this._propArr[loc1] as ItemData).itemAmount;
                    ++loc1;
                }
                this._baseItem.setAmountText(this._hasAmount);
                this._baseItemII.setAmountText(this._hasAmount);
                this._propArr.sort(this.blindSort);
            }
            else 
            {
                this._baseItem.setAmountText(0);
                this._baseItem.filters = [FilterConst.colorFilter];
                this._baseItemII.setAmountText(0);
                this._baseItemII.filters = [FilterConst.colorFilter];
            }
            return;
        }

        /* internal  */blindSort(arg1: ItemData, arg2: ItemData): int
        {
            if (arg1.bind > arg2.bind) 
            {
                return 1;
            }
            if (arg1.bind < arg2.bind) 
            {
                return -1;
            }
            return 0;
        }

        /* internal  */getRealCount(arg1: int): int
        {
            var loc1=0;
            var loc2=arg1;
            switch (loc2) 
            {
                case EVIPType._EVIPTypeNormal:
                {
                    this._vipAddTx.visible = false;
                    return GameConst.EveryDayMaxCultureTimes;
                }
                case EVIPType._EVIPTypeWeek:
                {
                    this._vipAddTx.visible = true;
                    loc1 = (VIPConfig.instance.getVIPInfo("EVIPFightSpiritExtraCount") as VIPInfo).weekVal;
                    this._vipAddTx.text = Language.getStringByParam(71119, loc1);
                    return GameConst.EveryDayMaxCultureTimes + loc1;
                }
                case EVIPType._EVIPTypeMonth:
                {
                    this._vipAddTx.visible = true;
                    loc1 = (VIPConfig.instance.getVIPInfo("EVIPFightSpiritExtraCount") as VIPInfo).monthVal;
                    this._vipAddTx.text = Language.getStringByParam(71119, loc1);
                    return GameConst.EveryDayMaxCultureTimes + loc1;
                }
                case EVIPType._EVIPTypeHalfYear:
                {
                    this._vipAddTx.visible = true;
                    loc1 = (VIPConfig.instance.getVIPInfo("EVIPFightSpiritExtraCount") as VIPInfo).halfYearVal;
                    this._vipAddTx.text = Language.getStringByParam(71119, loc1);
                    return GameConst.EveryDayMaxCultureTimes + loc1;
                }
            }
            return GameConst.EveryDayMaxCultureTimes;
        }

        public addGrowthEffect(arg1: int, arg2: Boolean=false): void
        {
            var loc1=new Object /* flash.geom.Point */(Global.stage.mouseX, Global.stage.mouseY);
            var loc2=localToGlobal(new Object /* flash.geom.Point */(200, 292));
            AttriAddEffect.attriAdd(arg1, loc2.x, loc2.y, arg2);
            return;
        }

        public addLevelUpEffect(): void
        {
            if (this._hideTimer == null) 
            {
                this._hideTimer = new Object /* flash.utils.Timer */(1000);
                this._hideTimer.repeatCount = 3;
                this._hideTimer.addEventListener(flash.events.TimerEvent.TIMER_COMPLETE, this.onTimerCompleteHandler);
            }
            this._hideTimer.reset();
            this._hideTimer.start();
            this.playEffect();
            this._hintLabel.visible = true;
            this._hintLabel.htmlText = Language.getString(71117);
            var loc1=new GTextFormat();
            loc1.size = 35;
            loc1.bold = true;
            loc1.align = flash.text.TextFormatAlign.CENTER;
            this._hintLabel.textField.setTextFormat(loc1);
            this._hintLabel.y = 100;
            this._hintLabel.alpha = 1;
            TweenLite.to(this._hintLabel, 2, {"y": 60, "alpha": 0, "onComplete": this.levelUpEffectCompl});
            return;
        }

        /* internal  */playEffect(): void
        {
            if (this._effectPlayer == null) 
            {
                this._effectPlayer = new SWFPlayer();
            }
            this._effectPlayer.load("fightSpiritLevelUpShine.swf", ModelType.NormalSwf, null);
            this._effectPlayer.move(211, 263);
            this._effectPlayer.play();
            if (this.contains(this._effectPlayer) == false) 
            {
                this.addChild(this._effectPlayer);
            }
            return;
        }

        /* internal  */stopEffect(): void
        {
            if (this.contains(this._effectPlayer)) 
            {
                this._effectPlayer.stop();
                this.removeChild(this._effectPlayer);
            }
            return;
        }

        /* internal  */onTimerCompleteHandler(arg1: Object /* flash.events.Event */): void
        {
            this._hideTimer.stop();
            this.stopEffect();
            return;
        }

        /* internal  */levelUpEffectCompl(): void
        {
            this._hintLabel.visible = false;
            return;
        }

        /* internal */ /* var */_propArr: Array<any>;

        /* internal */ /* var */_hasAmount: int;

        /* internal */ /* var */_againBtn: GLoadedButton;

        /* internal */ /* var */_setLink: GTextFiled;

        /* internal */ /* var */_expRiseTx: Object /* flash.text.TextField */;

        /* internal */ /* var */_expHightRiseTx: Object /* flash.text.TextField */;

        /* internal */ /* var */_prograssBar: LongProgressBar;

        /* internal */ /* var */_mHightRiseTx: Object /* flash.text.TextField */;

        /* internal */ /* var */_txRiseCost: Object /* flash.text.TextField */;

        /* internal */ /* var */_txHightRiseCost: Object /* flash.text.TextField */;

        /* internal */ /* var */_helpTx: GTextFiled;

        /* internal */ /* var */_stCurBm: Object /* flash.display.Bitmap */;

        /* internal */ /* var */_stArrowBm: Object /* flash.display.Bitmap */;

        /* internal */ /* var */_mRiseTx: Object /* flash.text.TextField */;

        /* internal */ /* var */_stNextBm: Object /* flash.display.Bitmap */;

        /* internal */ /* var */_stCurExpBm: Object /* flash.display.Bitmap */;

        /* internal */ /* var */_stComBm: Object /* flash.display.Bitmap */;

        /* internal */ /* var */_stBestBm: Object /* flash.display.Bitmap */;

        /* internal */ /* var */_barCurLevelTx: Object /* flash.text.TextField */;

        /* internal */ /* var */_barNextLevelTx: Object /* flash.text.TextField */;

        /* internal */ /* var */_tFightSpirit: TFightSpirit;

        /* internal */ /* var */_todayCountTx: Object /* flash.text.TextField */;

        /* internal */ /* var */_riseComBtn: GButton;

        /* internal */ /* var */_riseBestBtn: GButton;

        /* internal */ /* var */_curAddSp: FightSpiritAttView;

        /* internal */ /* var */_newAddSp: FightSpiritAttView;

        /* internal */ /* var */_hintLabel: GLabel;

        /* internal */ /* var */_effectPlayer: SWFPlayer;

        /* internal */ /* var */_todayNum: int;

        /* internal */ /* var */_propNum: int;

        /* internal */ /* var */_hideTimer: Object /* flash.utils.Timer */;

        /* internal */ /* var */_vipAddTx: Object /* flash.text.TextField */;

        /* internal */ /* var */_itemBg: Object /* flash.display.Bitmap */;

        /* internal */ /* var */_baseItem: BaseItem;

        /* internal */ /* var */_itemBgII: Object /* flash.display.Bitmap */;

        /* internal */ /* var */_baseItemII: BaseItem;

        /* internal */ /* var */_idata: ItemData;
    }
